package com.ldp.designpatterns.review.structure.decorator.demo1.decorator;

import com.ldp.designpatterns.review.structure.decorator.demo1.component.Component;

/**
 * @ClassName Decorator
 * @Description TODO 第3步：创建抽象装饰器 Decorator
 * @Author lindipei
 * @Date 2023/10/20 17:17
 */
public class Decorator implements Component {
    // 持有的组件对象
    private Component component;

    public Decorator(Component component) {
        this.component = component;
    }

    @Override
    public void operation() {
        // 处理前后可以加一些附加功能
        component.operation();
    }
}
